fix(desktop): preserve Windows PATH for ACP probes#2533
Conversation
Goose install could report success while discovery still saw NotInstalled (binary in %USERPROFILE%\goose off PATH), blocking onboarding Next (block#2239). Install shells also dropped the process PATH on Windows so system npm was invisible for Codex/Claude adapters (block#2238). Console-subsystem probes stole focus via Git Bash. - Probe well-known Windows Node/npm/goose paths; fall back to process PATH for install shells; pin goose GOOSE_BIN_DIR to ~/.local/bin on Windows. - Post-install resolve check; SetupStep only shows Installed after discovery. - Centralize CREATE_NO_WINDOW via windows_console::hide_console (and buzz-dev-mcp hide helper) on spawn sites this fix touches. Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
…ECK AGAIN - Restore Justfile + CONTRIBUTING.md from main (accidental soft-reset squash had undone Hermit-pinned lefthook from block#2241). - beforeDevCommand: use `pnpm exec vite` instead of Unix-only `exec` (tauri.conf + instance-env) so Windows cmd can start the dev server. - After install success, reuse the existing CHECK AGAIN / CHECKING… pattern so rediscovery is not a permanent spinner. Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
Desktop launches buzz-acp windowless; without the same flag the adapter child (cmd.exe/node, buzz-agent, …) allocates its own console per agent. Refs: block#2292, PR block#2247 review Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
PATH often lists %LOCALAPPDATA%\Microsoft\WindowsApps\bash.exe first; that App Execution Alias launches WSL and can hang lookups (~15s+) while real Git Bash is sub-second. Prefer git-derived / install / registry paths, then PATH bash, and skip WindowsApps (and System32) on PATH. Refs: block#2328, PR block#2247 Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
Nested CreateProcess sites still flash consoles when the parent is windowless: buzz-agent MCP spawns and buzz-dev-mcp delegated rg. Refs: PR block#2247 review, block#2292 Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
- Route desktop spawns through windows_console::hide_console (runtime, taskkill); stop re-inlining CREATE_NO_WINDOW. - Add buzz-dev-mcp windows_console for std/tokio; use from shell + rg. - Single hide_console helper in buzz-acp and buzz-agent MCP spawn. - Drop redundant WindowsApps also_skip; one path_looks_like check. - Align Doctor/MCP PATH scan API + KEEP IN SYNC notes (full shared resolver deferred: buzz-agent forbids unsafe registry code). - SetupStep: one CheckAgainButton for auth-unknown and post-install. No push. Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
Signed-off-by: Aleix <aleixrodriala@gmail.com>
|
🤖 hey @aleixrodriala — thank you for this contribution. It covers a lot of ground: four crates, the Git Bash probe, nvm layouts, console-window suppression. Some of what it fixes is now on main and some of it we're still missing, so let me be specific about why I'm closing it. The PATH problem it set out to fix is now handled on main by three merged commits: #2563 ( Two things in here that I checked and are genuinely still gaps, if you want to pick either up as a focused PR:
For the record, the |
Summary
PATHwhen login-shell PATH discovery is unavailableThis is stacked on #2247 and should be reviewed as the single additional commit
06e8a5e9. Once #2247 lands, the effective diff should collapse todesktop/src-tauri/src/managed_agents/runtime/path.rs.Root cause
#2247 fixes PATH composition for the ACP install subprocess, but runtime discovery and launched agents use
managed_agents/runtime/path.rs::build_augmented_path()instead. On Windows,login_shell_path()is intentionallyNone, managed Node is unsupported, and the existing builder did not preserve the native process PATH or add well-known Node directories.As a result, a correctly installed npm shim such as
%APPDATA%\Buzz\node-tools\codex-acp.cmdstarts but cannot resolvenode.exe. Buzz then classifies the adapter as outdated and retries installation, leaving onboarding at Installation failed.User impact
The affected Windows v0.4.23 machine had Node and Codex installed. Installing
@agentclientprotocol/codex-acp1.1.7 into Buzz's private prefix was not sufficient: the live onboarding UI still failed. Reproducing Buzz's exact augmented PATH produced"node" is not recognized as an internal or external command.A temporary local Node delegate placed in Buzz's managed prefix made the exact probe succeed and clicking Retry changed the live UI to Ready. That delegate is only a local workaround and is not part of this PR; this source change fixes the underlying PATH construction.
Validation
@agentclientprotocol/codex-acp 1.1.7; onboarding confirmed Readyruntime/path.rstests: 7 passed, 0 failedrustfmt --edition 2021 desktop/src-tauri/src/managed_agents/runtime/path.rsgit diff --checkThe full Tauri crate test was not completed in this WSL environment because its Linux build requires the full WebKitGTK development stack.